<style>
    .home-dacontent {
        margin-top: 10px;
        padding: 10px 15px;
        background-color: #F2F2F5;
        border-radius: 5px;
        word-wrap: break-word;
    }
</style>

<main class="lyear-layout-content">
    <div class="container-fluid p-t-15">
        <div class="row">
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb" style="padding: 1.25rem 1rem;background-color: white;">
                        <li class="breadcrumb-item"><a href="{:url('admin/user/index')}"
                                style="color: #33cabb;">用户列表</a>
                        </li>
                        <li class="breadcrumb-item active" aria-current="page">用户详情</li>
                    </ol>
                </nav>
                <!-- </div> -->
            </div>
        </div>

        <div class="row">
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-body">
                        <div class="card-body">
                            <ul class="nav nav-tabs nav-fill">
                                <li class="nav-item">
                                    <a class="nav-link {$type == 'info' ? 'active' : ''}" data-toggle="tab" href="#info"
                                        aria-selected="true">用户个人信息</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link {$type == 'message' ? 'active' : ''}" data-toggle="tab"
                                        href="#message" aria-selected="false">用户消费记录</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link {$type == 'comment' ? 'active' : ''}" data-toggle="tab"
                                        href="#comment" aria-selected="false">用户历史评论</a>
                                </li>
                            </ul>
                            <div class="tab-content">
                                <div class="tab-pane fade {$type == 'info' ? 'show active' : ''}" id="info"
                                    role="tabpanel">
                                    <div class="row">
                                        <div class="form-group col-lg-3">
                                            <label for="type">昵称</label>
                                            <input name="nickname" class="form-control" id="nickname"
                                                value="{$user.nickname}">
                                        </div>
                                        <div class="form-group col-lg-3">
                                            <label for="email">邮箱</label>
                                            <input type="text" class="form-control" id="email" name="email"
                                                value="{$user.email}">
                                        </div>
                                        <div class="form-group col-lg-3">
                                            <label for="sex">性别</label>
                                            <input type="text" class="form-control" id="sex" name="sex"
                                                value="{$user.sex_text}">
                                        </div>
                                        <div class="form-group col-lg-3" style="text-align: center;">
                                            <img class="rounded"
                                                src="{$item.avatar ? $item.avatar : '/static/home/res/images/avatar/default.png'}"
                                                alt="{$user.nickname}" width="100" height="100" />
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="form-group col-lg-3">
                                            <label for="sex">所在地</label>
                                            <input type="text" class="form-control"
                                                value="{$user.provinces ?
                                                $user.provinces.name.'-'.$user.citys.name.'-'.$user.districts.name : '保密'}">
                                        </div>
                                        <div class="form-group col-lg-3">
                                            <label for="content">认证状态</label>
                                            <input class="form-control" id="auth" name="auth"
                                                value="{$user.auth_text}" />
                                        </div>
                                        <div class="form-group col-lg-3">
                                            <label for="vip">VIP等级</label>
                                            <input class="form-control" id="vip" name="vip" value="{$user.vip}" />
                                        </div>
                                        <div class="form-group col-lg-3">
                                            <label for="point">积分</label>
                                            <input class="form-control" id="point" name="point" value="{$user.point}" />
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="form-group col-lg-3">
                                            <label for="point">入坑时间</label>
                                            <input class="form-control" id="point" name="point"
                                                value="{$user.createtime}" />
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label for="content">个人描述</label>
                                        <textarea class="form-control" id="content" name="content" rows="5"
                                            placeholder="描述" style="resize: none;">{$user.content}</textarea>
                                    </div>

                                    <div class="form-group">
                                        <label for="tags">个人空间背景图</label>
                                        <img class="" src="{$user.cover_cdn}""/>
                                    </div>
                                </div>

                                <div class=" tab-pane fade {$type=='message' ? 'show active' : '' }" id="message"
                                            role="tabpanel">
                                        <div class="list-group">
                                            {foreach $recordList as $item}
                                            <a href="#!"
                                                class="list-group-item list-group-item-action flex-column align-items-start ">
                                                <div class="d-flex w-100 justify-content-between">
                                                    <h5 class="mb-1">消息类型：<span class="badge {$item.state_class}">{$item.state_text}</span></h5>
                                                    <small>消费时间：{$item.createtime_text}</small>
                                                </div>
                                                <p class="mb-1">
                                                    {$item.content}
                                                </p>
                                            </a>
                                            {/foreach}
                                        </div>
                                        <div style="text-align: center">{$recordList->render()}</div>
                                    </div>

                                    <div class=" tab-pane fade {$type=='comment' ? 'show active' : '' }" id="comment"
                                        role="tabpanel">
                                        <div class="list-group">
                                            {foreach $commentList as $item}
                                            <a href="#!"
                                                class="list-group-item list-group-item-action flex-column align-items-start ">
                                                <div class="row">
                                                    <h5 class="mb-1 col-lg-4">所属帖子：<span class="badge badge-cyan">{$item.post.title}</span></h5>
                                                    <p class="col-lg-4"><i class="mdi mdi-cards-heart" style="color: red;"></i>点赞数：{$item.like_count}</p>
                                                    <small class="col-lg-4" style="text-align: right;">{$item.createtime_text}</small>
                                                </div>
                                                <div class="mb-1">
                                                    <h5>评论内容：</h5>
                                                    <div class="home-dacontent">
                                                        {$item.content}
                                                    </div>
                                                </div>
                                            </a>
                                            {/foreach}
                                        </div>
                                        <div style="text-align: center">{$commentList->render()}</div>
                                    </div>

                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
</main>